\(\int \frac {(c+d \tan (e+f x)) (A+B \tan (e+f x)+C \tan ^2(e+f x))}{(a+b \tan (e+f x))^2} \, dx\) [55]
Optimal result
Integrand size = 43, antiderivative size = 265 \[
\int \frac {(c+d \tan (e+f x)) \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^2} \, dx=\frac {\left (a^2 (A c-c C-B d)-b^2 (A c-c C-B d)+2 a b (B c+(A-C) d)\right ) x}{\left (a^2+b^2\right )^2}+\frac {\left (2 a b (A c-c C-B d)-a^2 (B c+(A-C) d)+b^2 (B c+(A-C) d)\right ) \log (\cos (e+f x))}{\left (a^2+b^2\right )^2 f}+\frac {\left (a^4 C d+b^4 (B c+A d)+2 a b^3 (A c-c C-B d)-a^2 b^2 (B c+(A-3 C) d)\right ) \log (a+b \tan (e+f x))}{b^2 \left (a^2+b^2\right )^2 f}-\frac {\left (A b^2-a (b B-a C)\right ) (b c-a d)}{b^2 \left (a^2+b^2\right ) f (a+b \tan (e+f x))}
\]
[Out]
(a^2*(A*c-B*d-C*c)-b^2*(A*c-B*d-C*c)+2*a*b*(B*c+(A-C)*d))*x/(a^2+b^2)^2+(2*a*b*(A*c-B*d-C*c)-a^2*(B*c+(A-C)*d)
+b^2*(B*c+(A-C)*d))*ln(cos(f*x+e))/(a^2+b^2)^2/f+(a^4*C*d+b^4*(A*d+B*c)+2*a*b^3*(A*c-B*d-C*c)-a^2*b^2*(B*c+(A-
3*C)*d))*ln(a+b*tan(f*x+e))/b^2/(a^2+b^2)^2/f-(A*b^2-a*(B*b-C*a))*(-a*d+b*c)/b^2/(a^2+b^2)/f/(a+b*tan(f*x+e))
Rubi [A] (verified)
Time = 0.52 (sec) , antiderivative size = 265, normalized size of antiderivative = 1.00, number of
steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.116, Rules used = {3716, 3707, 3698, 31, 3556}
\[
\int \frac {(c+d \tan (e+f x)) \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^2} \, dx=-\frac {(b c-a d) \left (A b^2-a (b B-a C)\right )}{b^2 f \left (a^2+b^2\right ) (a+b \tan (e+f x))}+\frac {\log (\cos (e+f x)) \left (-\left (a^2 (d (A-C)+B c)\right )+2 a b (A c-B d-c C)+b^2 (d (A-C)+B c)\right )}{f \left (a^2+b^2\right )^2}+\frac {x \left (a^2 (A c-B d-c C)+2 a b (d (A-C)+B c)-b^2 (A c-B d-c C)\right )}{\left (a^2+b^2\right )^2}+\frac {\left (a^4 C d-a^2 b^2 (d (A-3 C)+B c)+2 a b^3 (A c-B d-c C)+b^4 (A d+B c)\right ) \log (a+b \tan (e+f x))}{b^2 f \left (a^2+b^2\right )^2}
\]
[In]
Int[((c + d*Tan[e + f*x])*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2))/(a + b*Tan[e + f*x])^2,x]
[Out]
((a^2*(A*c - c*C - B*d) - b^2*(A*c - c*C - B*d) + 2*a*b*(B*c + (A - C)*d))*x)/(a^2 + b^2)^2 + ((2*a*b*(A*c - c
*C - B*d) - a^2*(B*c + (A - C)*d) + b^2*(B*c + (A - C)*d))*Log[Cos[e + f*x]])/((a^2 + b^2)^2*f) + ((a^4*C*d +
b^4*(B*c + A*d) + 2*a*b^3*(A*c - c*C - B*d) - a^2*b^2*(B*c + (A - 3*C)*d))*Log[a + b*Tan[e + f*x]])/(b^2*(a^2
+ b^2)^2*f) - ((A*b^2 - a*(b*B - a*C))*(b*c - a*d))/(b^2*(a^2 + b^2)*f*(a + b*Tan[e + f*x]))
Rule 31
Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]
Rule 3556
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]
Rule 3698
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Dist[
A/(b*f), Subst[Int[(a + x)^m, x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, A, C, m}, x] && EqQ[A, C]
Rule 3707
Int[((A_) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2)/((a_.) + (b_.)*tan[(e_.) + (f_.)*
(x_)]), x_Symbol] :> Simp[(a*A + b*B - a*C)*(x/(a^2 + b^2)), x] + (Dist[(A*b^2 - a*b*B + a^2*C)/(a^2 + b^2), I
nt[(1 + Tan[e + f*x]^2)/(a + b*Tan[e + f*x]), x], x] - Dist[(A*b - a*B - b*C)/(a^2 + b^2), Int[Tan[e + f*x], x
], x]) /; FreeQ[{a, b, e, f, A, B, C}, x] && NeQ[A*b^2 - a*b*B + a^2*C, 0] && NeQ[a^2 + b^2, 0] && NeQ[A*b - a
*B - b*C, 0]
Rule 3716
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)*((A_.) + (B_.)*tan[(e
_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-(b*c - a*d))*(c^2*C - B*c*d + A*d^2)
*((c + d*Tan[e + f*x])^(n + 1)/(d^2*f*(n + 1)*(c^2 + d^2))), x] + Dist[1/(d*(c^2 + d^2)), Int[(c + d*Tan[e + f
*x])^(n + 1)*Simp[a*d*(A*c - c*C + B*d) + b*(c^2*C - B*c*d + A*d^2) + d*(A*b*c + a*B*c - b*c*C - a*A*d + b*B*d
+ a*C*d)*Tan[e + f*x] + b*C*(c^2 + d^2)*Tan[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C}, x] &
& NeQ[b*c - a*d, 0] && NeQ[c^2 + d^2, 0] && LtQ[n, -1]
Rubi steps \begin{align*}
\text {integral}& = -\frac {\left (A b^2-a (b B-a C)\right ) (b c-a d)}{b^2 \left (a^2+b^2\right ) f (a+b \tan (e+f x))}+\frac {\int \frac {a^2 C d+b^2 (B c+A d)+a b (A c-c C-B d)-b (A b c-a B c-b c C-a A d-b B d+a C d) \tan (e+f x)+\left (a^2+b^2\right ) C d \tan ^2(e+f x)}{a+b \tan (e+f x)} \, dx}{b \left (a^2+b^2\right )} \\ & = \frac {\left (a^2 (A c-c C-B d)-b^2 (A c-c C-B d)+2 a b (B c+(A-C) d)\right ) x}{\left (a^2+b^2\right )^2}-\frac {\left (A b^2-a (b B-a C)\right ) (b c-a d)}{b^2 \left (a^2+b^2\right ) f (a+b \tan (e+f x))}+\frac {\left (a^4 C d+b^4 (B c+A d)+2 a b^3 (A c-c C-B d)-a^2 b^2 (B c+(A-3 C) d)\right ) \int \frac {1+\tan ^2(e+f x)}{a+b \tan (e+f x)} \, dx}{b \left (a^2+b^2\right )^2}-\frac {\left (2 a b (A c-c C-B d)-a^2 (B c+(A-C) d)+b^2 (B c+(A-C) d)\right ) \int \tan (e+f x) \, dx}{\left (a^2+b^2\right )^2} \\ & = \frac {\left (a^2 (A c-c C-B d)-b^2 (A c-c C-B d)+2 a b (B c+(A-C) d)\right ) x}{\left (a^2+b^2\right )^2}+\frac {\left (2 a b (A c-c C-B d)-a^2 (B c+(A-C) d)+b^2 (B c+(A-C) d)\right ) \log (\cos (e+f x))}{\left (a^2+b^2\right )^2 f}-\frac {\left (A b^2-a (b B-a C)\right ) (b c-a d)}{b^2 \left (a^2+b^2\right ) f (a+b \tan (e+f x))}+\frac {\left (a^4 C d+b^4 (B c+A d)+2 a b^3 (A c-c C-B d)-a^2 b^2 (B c+(A-3 C) d)\right ) \text {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \tan (e+f x)\right )}{b^2 \left (a^2+b^2\right )^2 f} \\ & = \frac {\left (a^2 (A c-c C-B d)-b^2 (A c-c C-B d)+2 a b (B c+(A-C) d)\right ) x}{\left (a^2+b^2\right )^2}+\frac {\left (2 a b (A c-c C-B d)-a^2 (B c+(A-C) d)+b^2 (B c+(A-C) d)\right ) \log (\cos (e+f x))}{\left (a^2+b^2\right )^2 f}+\frac {\left (a^4 C d+b^4 (B c+A d)+2 a b^3 (A c-c C-B d)-a^2 b^2 (B c+(A-3 C) d)\right ) \log (a+b \tan (e+f x))}{b^2 \left (a^2+b^2\right )^2 f}-\frac {\left (A b^2-a (b B-a C)\right ) (b c-a d)}{b^2 \left (a^2+b^2\right ) f (a+b \tan (e+f x))} \\
\end{align*}
Mathematica [C] (verified)
Result contains complex when optimal does not.
Time = 2.79 (sec) , antiderivative size = 216, normalized size of antiderivative = 0.82
\[
\int \frac {(c+d \tan (e+f x)) \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^2} \, dx=\frac {\frac {(A+i B-C) (-i c+d) \log (i-\tan (e+f x))}{(a+i b)^2}+\frac {(A-i B-C) (i c+d) \log (i+\tan (e+f x))}{(a-i b)^2}+\frac {2 \left (a^4 C d+b^4 (B c+A d)+2 a b^3 (A c-c C-B d)-a^2 b^2 (B c+(A-3 C) d)\right ) \log (a+b \tan (e+f x))}{b^2 \left (a^2+b^2\right )^2}-\frac {2 \left (A b^2+a (-b B+a C)\right ) (b c-a d)}{b^2 \left (a^2+b^2\right ) (a+b \tan (e+f x))}}{2 f}
\]
[In]
Integrate[((c + d*Tan[e + f*x])*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2))/(a + b*Tan[e + f*x])^2,x]
[Out]
(((A + I*B - C)*((-I)*c + d)*Log[I - Tan[e + f*x]])/(a + I*b)^2 + ((A - I*B - C)*(I*c + d)*Log[I + Tan[e + f*x
]])/(a - I*b)^2 + (2*(a^4*C*d + b^4*(B*c + A*d) + 2*a*b^3*(A*c - c*C - B*d) - a^2*b^2*(B*c + (A - 3*C)*d))*Log
[a + b*Tan[e + f*x]])/(b^2*(a^2 + b^2)^2) - (2*(A*b^2 + a*(-(b*B) + a*C))*(b*c - a*d))/(b^2*(a^2 + b^2)*(a + b
*Tan[e + f*x])))/(2*f)
Maple [A] (verified)
Time = 0.14 (sec) , antiderivative size = 321, normalized size of antiderivative = 1.21
| | |
method | result | size |
| | |
derivativedivides |
\(\frac {-\frac {-A a \,b^{2} d +A \,b^{3} c +B \,a^{2} b d -B a \,b^{2} c -a^{3} C d +C \,a^{2} b c}{b^{2} \left (a^{2}+b^{2}\right ) \left (a +b \tan \left (f x +e \right )\right )}+\frac {\left (-A \,a^{2} b^{2} d +2 A a \,b^{3} c +A \,b^{4} d -B \,a^{2} b^{2} c -2 B a \,b^{3} d +B \,b^{4} c +a^{4} C d +3 C \,a^{2} b^{2} d -2 C a \,b^{3} c \right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right )^{2} b^{2}}+\frac {\frac {\left (A \,a^{2} d -2 A a b c -A \,b^{2} d +B \,a^{2} c +2 B a b d -B \,b^{2} c -C \,a^{2} d +2 C a b c +d C \,b^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}+\left (A \,a^{2} c +2 A a b d -A \,b^{2} c -B \,a^{2} d +2 B a b c +B \,b^{2} d -C \,a^{2} c -2 C a b d +C \,b^{2} c \right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right )^{2}}}{f}\) |
\(321\) |
default |
\(\frac {-\frac {-A a \,b^{2} d +A \,b^{3} c +B \,a^{2} b d -B a \,b^{2} c -a^{3} C d +C \,a^{2} b c}{b^{2} \left (a^{2}+b^{2}\right ) \left (a +b \tan \left (f x +e \right )\right )}+\frac {\left (-A \,a^{2} b^{2} d +2 A a \,b^{3} c +A \,b^{4} d -B \,a^{2} b^{2} c -2 B a \,b^{3} d +B \,b^{4} c +a^{4} C d +3 C \,a^{2} b^{2} d -2 C a \,b^{3} c \right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right )^{2} b^{2}}+\frac {\frac {\left (A \,a^{2} d -2 A a b c -A \,b^{2} d +B \,a^{2} c +2 B a b d -B \,b^{2} c -C \,a^{2} d +2 C a b c +d C \,b^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}+\left (A \,a^{2} c +2 A a b d -A \,b^{2} c -B \,a^{2} d +2 B a b c +B \,b^{2} d -C \,a^{2} c -2 C a b d +C \,b^{2} c \right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right )^{2}}}{f}\) |
\(321\) |
norman |
\(\frac {\frac {a \left (A \,a^{2} c +2 A a b d -A \,b^{2} c -B \,a^{2} d +2 B a b c +B \,b^{2} d -C \,a^{2} c -2 C a b d +C \,b^{2} c \right ) x}{a^{4}+2 a^{2} b^{2}+b^{4}}+\frac {A a \,b^{2} d -A \,b^{3} c -B \,a^{2} b d +B a \,b^{2} c +a^{3} C d -C \,a^{2} b c}{b^{2} f \left (a^{2}+b^{2}\right )}+\frac {b \left (A \,a^{2} c +2 A a b d -A \,b^{2} c -B \,a^{2} d +2 B a b c +B \,b^{2} d -C \,a^{2} c -2 C a b d +C \,b^{2} c \right ) x \tan \left (f x +e \right )}{a^{4}+2 a^{2} b^{2}+b^{4}}}{a +b \tan \left (f x +e \right )}+\frac {\left (A \,a^{2} d -2 A a b c -A \,b^{2} d +B \,a^{2} c +2 B a b d -B \,b^{2} c -C \,a^{2} d +2 C a b c +d C \,b^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}-\frac {\left (A \,a^{2} b^{2} d -2 A a \,b^{3} c -A \,b^{4} d +B \,a^{2} b^{2} c +2 B a \,b^{3} d -B \,b^{4} c -a^{4} C d -3 C \,a^{2} b^{2} d +2 C a \,b^{3} c \right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{\left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) f \,b^{2}}\) |
\(439\) |
parallelrisch |
\(\text {Expression too large to display}\) |
\(1210\) |
risch |
\(\text {Expression too large to display}\) |
\(1523\) |
| | |
|
|
|
[In]
int((c+d*tan(f*x+e))*(A+B*tan(f*x+e)+C*tan(f*x+e)^2)/(a+b*tan(f*x+e))^2,x,method=_RETURNVERBOSE)
[Out]
1/f*(-(-A*a*b^2*d+A*b^3*c+B*a^2*b*d-B*a*b^2*c-C*a^3*d+C*a^2*b*c)/b^2/(a^2+b^2)/(a+b*tan(f*x+e))+1/(a^2+b^2)^2*
(-A*a^2*b^2*d+2*A*a*b^3*c+A*b^4*d-B*a^2*b^2*c-2*B*a*b^3*d+B*b^4*c+C*a^4*d+3*C*a^2*b^2*d-2*C*a*b^3*c)/b^2*ln(a+
b*tan(f*x+e))+1/(a^2+b^2)^2*(1/2*(A*a^2*d-2*A*a*b*c-A*b^2*d+B*a^2*c+2*B*a*b*d-B*b^2*c-C*a^2*d+2*C*a*b*c+C*b^2*
d)*ln(1+tan(f*x+e)^2)+(A*a^2*c+2*A*a*b*d-A*b^2*c-B*a^2*d+2*B*a*b*c+B*b^2*d-C*a^2*c-2*C*a*b*d+C*b^2*c)*arctan(t
an(f*x+e))))
Fricas [B] (verification not implemented)
Leaf count of result is larger than twice the leaf count of optimal. 556 vs. \(2 (265) = 530\).
Time = 0.39 (sec) , antiderivative size = 556, normalized size of antiderivative = 2.10
\[
\int \frac {(c+d \tan (e+f x)) \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^2} \, dx=\frac {2 \, {\left ({\left ({\left (A - C\right )} a^{3} b^{2} + 2 \, B a^{2} b^{3} - {\left (A - C\right )} a b^{4}\right )} c - {\left (B a^{3} b^{2} - 2 \, {\left (A - C\right )} a^{2} b^{3} - B a b^{4}\right )} d\right )} f x - 2 \, {\left (C a^{2} b^{3} - B a b^{4} + A b^{5}\right )} c + 2 \, {\left (C a^{3} b^{2} - B a^{2} b^{3} + A a b^{4}\right )} d - {\left ({\left (B a^{3} b^{2} - 2 \, {\left (A - C\right )} a^{2} b^{3} - B a b^{4}\right )} c - {\left (C a^{5} - {\left (A - 3 \, C\right )} a^{3} b^{2} - 2 \, B a^{2} b^{3} + A a b^{4}\right )} d + {\left ({\left (B a^{2} b^{3} - 2 \, {\left (A - C\right )} a b^{4} - B b^{5}\right )} c - {\left (C a^{4} b - {\left (A - 3 \, C\right )} a^{2} b^{3} - 2 \, B a b^{4} + A b^{5}\right )} d\right )} \tan \left (f x + e\right )\right )} \log \left (\frac {b^{2} \tan \left (f x + e\right )^{2} + 2 \, a b \tan \left (f x + e\right ) + a^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) - {\left ({\left (C a^{4} b + 2 \, C a^{2} b^{3} + C b^{5}\right )} d \tan \left (f x + e\right ) + {\left (C a^{5} + 2 \, C a^{3} b^{2} + C a b^{4}\right )} d\right )} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right ) + 2 \, {\left ({\left ({\left ({\left (A - C\right )} a^{2} b^{3} + 2 \, B a b^{4} - {\left (A - C\right )} b^{5}\right )} c - {\left (B a^{2} b^{3} - 2 \, {\left (A - C\right )} a b^{4} - B b^{5}\right )} d\right )} f x + {\left (C a^{3} b^{2} - B a^{2} b^{3} + A a b^{4}\right )} c - {\left (C a^{4} b - B a^{3} b^{2} + A a^{2} b^{3}\right )} d\right )} \tan \left (f x + e\right )}{2 \, {\left ({\left (a^{4} b^{3} + 2 \, a^{2} b^{5} + b^{7}\right )} f \tan \left (f x + e\right ) + {\left (a^{5} b^{2} + 2 \, a^{3} b^{4} + a b^{6}\right )} f\right )}}
\]
[In]
integrate((c+d*tan(f*x+e))*(A+B*tan(f*x+e)+C*tan(f*x+e)^2)/(a+b*tan(f*x+e))^2,x, algorithm="fricas")
[Out]
1/2*(2*(((A - C)*a^3*b^2 + 2*B*a^2*b^3 - (A - C)*a*b^4)*c - (B*a^3*b^2 - 2*(A - C)*a^2*b^3 - B*a*b^4)*d)*f*x -
2*(C*a^2*b^3 - B*a*b^4 + A*b^5)*c + 2*(C*a^3*b^2 - B*a^2*b^3 + A*a*b^4)*d - ((B*a^3*b^2 - 2*(A - C)*a^2*b^3 -
B*a*b^4)*c - (C*a^5 - (A - 3*C)*a^3*b^2 - 2*B*a^2*b^3 + A*a*b^4)*d + ((B*a^2*b^3 - 2*(A - C)*a*b^4 - B*b^5)*c
- (C*a^4*b - (A - 3*C)*a^2*b^3 - 2*B*a*b^4 + A*b^5)*d)*tan(f*x + e))*log((b^2*tan(f*x + e)^2 + 2*a*b*tan(f*x
+ e) + a^2)/(tan(f*x + e)^2 + 1)) - ((C*a^4*b + 2*C*a^2*b^3 + C*b^5)*d*tan(f*x + e) + (C*a^5 + 2*C*a^3*b^2 + C
*a*b^4)*d)*log(1/(tan(f*x + e)^2 + 1)) + 2*((((A - C)*a^2*b^3 + 2*B*a*b^4 - (A - C)*b^5)*c - (B*a^2*b^3 - 2*(A
- C)*a*b^4 - B*b^5)*d)*f*x + (C*a^3*b^2 - B*a^2*b^3 + A*a*b^4)*c - (C*a^4*b - B*a^3*b^2 + A*a^2*b^3)*d)*tan(f
*x + e))/((a^4*b^3 + 2*a^2*b^5 + b^7)*f*tan(f*x + e) + (a^5*b^2 + 2*a^3*b^4 + a*b^6)*f)
Sympy [C] (verification not implemented)
Result contains complex when optimal does not.
Time = 1.41 (sec) , antiderivative size = 9721, normalized size of antiderivative = 36.68
\[
\int \frac {(c+d \tan (e+f x)) \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^2} \, dx=\text {Too large to display}
\]
[In]
integrate((c+d*tan(f*x+e))*(A+B*tan(f*x+e)+C*tan(f*x+e)**2)/(a+b*tan(f*x+e))**2,x)
[Out]
Piecewise((zoo*x*(c + d*tan(e))*(A + B*tan(e) + C*tan(e)**2)/tan(e)**2, Eq(a, 0) & Eq(b, 0) & Eq(f, 0)), ((A*c
*x + A*d*log(tan(e + f*x)**2 + 1)/(2*f) + B*c*log(tan(e + f*x)**2 + 1)/(2*f) - B*d*x + B*d*tan(e + f*x)/f - C*
c*x + C*c*tan(e + f*x)/f - C*d*log(tan(e + f*x)**2 + 1)/(2*f) + C*d*tan(e + f*x)**2/(2*f))/a**2, Eq(b, 0)), (-
A*c*f*x*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 2*I*A*c*f*x*tan(e +
f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + A*c*f*x/(4*b**2*f*tan(e + f*x)**2 - 8*I
*b**2*f*tan(e + f*x) - 4*b**2*f) - A*c*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b*
*2*f) + 2*I*A*c/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + I*A*d*f*x*tan(e + f*x)**2/(4
*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 2*A*d*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*x)*
*2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - I*A*d*f*x/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b
**2*f) + I*A*d*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + I*B*c*f*x*tan(e
+ f*x)**2/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 2*B*c*f*x*tan(e + f*x)/(4*b**2*f*t
an(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - I*B*c*f*x/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e
+ f*x) - 4*b**2*f) + I*B*c*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + B*d*
f*x*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 2*I*B*d*f*x*tan(e + f*x)
/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - B*d*f*x/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**
2*f*tan(e + f*x) - 4*b**2*f) - 3*B*d*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2
*f) + 2*I*B*d/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + C*c*f*x*tan(e + f*x)**2/(4*b**
2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 2*I*C*c*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2
- 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - C*c*f*x/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*
f) - 3*C*c*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 2*I*C*c/(4*b**2*f*ta
n(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 3*I*C*d*f*x*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 -
8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 6*C*d*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*
x) - 4*b**2*f) - 3*I*C*d*f*x/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 2*C*d*log(tan(e
+ f*x)**2 + 1)*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 4*I*C*d*log(
tan(e + f*x)**2 + 1)*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 2*C*d*log(
tan(e + f*x)**2 + 1)/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 5*I*C*d*tan(e + f*x)/(4
*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 4*C*d/(4*b**2*f*tan(e + f*x)**2 - 8*I*b**2*f*t
an(e + f*x) - 4*b**2*f), Eq(a, -I*b)), (-A*c*f*x*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e
+ f*x) - 4*b**2*f) - 2*I*A*c*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f)
+ A*c*f*x/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - A*c*tan(e + f*x)/(4*b**2*f*tan(e +
f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 2*I*A*c/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) -
4*b**2*f) - I*A*d*f*x*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 2*A*d
*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + I*A*d*f*x/(4*b**2*f*tan(e
+ f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - I*A*d*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*ta
n(e + f*x) - 4*b**2*f) - I*B*c*f*x*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**
2*f) + 2*B*c*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + I*B*c*f*x/(4*b
**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - I*B*c*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8
*I*b**2*f*tan(e + f*x) - 4*b**2*f) + B*d*f*x*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*
x) - 4*b**2*f) + 2*I*B*d*f*x*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - B*
d*f*x/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 3*B*d*tan(e + f*x)/(4*b**2*f*tan(e + f
*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 2*I*B*d/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4
*b**2*f) + C*c*f*x*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 2*I*C*c*f
*x*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - C*c*f*x/(4*b**2*f*tan(e + f*
x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 3*C*c*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e
+ f*x) - 4*b**2*f) - 2*I*C*c/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 3*I*C*d*f*x*tan
(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 6*C*d*f*x*tan(e + f*x)/(4*b**2*
f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) + 3*I*C*d*f*x/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*t
an(e + f*x) - 4*b**2*f) + 2*C*d*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*
f*tan(e + f*x) - 4*b**2*f) + 4*I*C*d*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**
2*f*tan(e + f*x) - 4*b**2*f) - 2*C*d*log(tan(e + f*x)**2 + 1)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f
*x) - 4*b**2*f) + 5*I*C*d*tan(e + f*x)/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f) - 4*C*d
/(4*b**2*f*tan(e + f*x)**2 + 8*I*b**2*f*tan(e + f*x) - 4*b**2*f), Eq(a, I*b)), (x*(c + d*tan(e))*(A + B*tan(e)
+ C*tan(e)**2)/(a + b*tan(e))**2, Eq(f, 0)), (2*A*a**3*b**2*c*f*x/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x)
+ 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) - 2*A*a**3*b**2*d*log(a/b
+ tan(e + f*x))/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a
*b**6*f + 2*b**7*f*tan(e + f*x)) + A*a**3*b**2*d*log(tan(e + f*x)**2 + 1)/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e
+ f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + 2*A*a**3*b**2*d/(
2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*
f*tan(e + f*x)) + 2*A*a**2*b**3*c*f*x*tan(e + f*x)/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f
+ 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + 4*A*a**2*b**3*c*log(a/b + tan(e + f*x))/
(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7
*f*tan(e + f*x)) - 2*A*a**2*b**3*c*log(tan(e + f*x)**2 + 1)/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a*
*3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) - 2*A*a**2*b**3*c/(2*a**5*b**2*f
+ 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)
) + 4*A*a**2*b**3*d*f*x/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*
x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) - 2*A*a**2*b**3*d*log(a/b + tan(e + f*x))*tan(e + f*x)/(2*a**5*b**2*f
+ 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x
)) + A*a**2*b**3*d*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*
b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) - 2*A*a*b**4*c*f*x/(2*a**5*b**2*f +
2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x))
+ 4*A*a*b**4*c*log(a/b + tan(e + f*x))*tan(e + f*x)/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*
f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) - 2*A*a*b**4*c*log(tan(e + f*x)**2 + 1)*t
an(e + f*x)/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**
6*f + 2*b**7*f*tan(e + f*x)) + 4*A*a*b**4*d*f*x*tan(e + f*x)/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a
**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + 2*A*a*b**4*d*log(a/b + tan(e +
f*x))/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f +
2*b**7*f*tan(e + f*x)) - A*a*b**4*d*log(tan(e + f*x)**2 + 1)/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*
a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + 2*A*a*b**4*d/(2*a**5*b**2*f +
2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x))
- 2*A*b**5*c*f*x*tan(e + f*x)/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan
(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) - 2*A*b**5*c/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a
**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + 2*A*b**5*d*log(a/b + tan(e + f
*x))*tan(e + f*x)/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2
*a*b**6*f + 2*b**7*f*tan(e + f*x)) - A*b**5*d*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*a**5*b**2*f + 2*a**4*b*
*3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) - 2*B*a**
4*b*d/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f +
2*b**7*f*tan(e + f*x)) - 2*B*a**3*b**2*c*log(a/b + tan(e + f*x))/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) +
4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + B*a**3*b**2*c*log(tan(e +
f*x)**2 + 1)/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b*
*6*f + 2*b**7*f*tan(e + f*x)) + 2*B*a**3*b**2*c/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f +
4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) - 2*B*a**3*b**2*d*f*x/(2*a**5*b**2*f + 2*a**4
*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + 4*B*
a**2*b**3*c*f*x/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a
*b**6*f + 2*b**7*f*tan(e + f*x)) - 2*B*a**2*b**3*c*log(a/b + tan(e + f*x))*tan(e + f*x)/(2*a**5*b**2*f + 2*a**
4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + B*a
**2*b**3*c*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f +
4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) - 2*B*a**2*b**3*d*f*x*tan(e + f*x)/(2*a**5*b
**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e
+ f*x)) - 4*B*a**2*b**3*d*log(a/b + tan(e + f*x))/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f
+ 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + 2*B*a**2*b**3*d*log(tan(e + f*x)**2 + 1)/
(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7
*f*tan(e + f*x)) - 2*B*a**2*b**3*d/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f
*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + 4*B*a*b**4*c*f*x*tan(e + f*x)/(2*a**5*b**2*f + 2*a**4*b*
*3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + 2*B*a*b
**4*c*log(a/b + tan(e + f*x))/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(
e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) - B*a*b**4*c*log(tan(e + f*x)**2 + 1)/(2*a**5*b**2*f + 2*a**4*b
**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + 2*B*a*
b**4*c/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f +
2*b**7*f*tan(e + f*x)) + 2*B*a*b**4*d*f*x/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**
2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) - 4*B*a*b**4*d*log(a/b + tan(e + f*x))*tan(e + f*x
)/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b*
*7*f*tan(e + f*x)) + 2*B*a*b**4*d*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e +
f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + 2*B*b**5*c*log(a/b
+ tan(e + f*x))*tan(e + f*x)/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e
+ f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) - B*b**5*c*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*a**5*b**2*f
+ 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)
) + 2*B*b**5*d*f*x*tan(e + f*x)/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*ta
n(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + 2*C*a**5*d*log(a/b + tan(e + f*x))/(2*a**5*b**2*f + 2*a**4*
b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + 2*C*a
**5*d/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f +
2*b**7*f*tan(e + f*x)) - 2*C*a**4*b*c/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**
5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + 2*C*a**4*b*d*log(a/b + tan(e + f*x))*tan(e + f*x)/(2*
a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*
tan(e + f*x)) - 2*C*a**3*b**2*c*f*x/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*
f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + 6*C*a**3*b**2*d*log(a/b + tan(e + f*x))/(2*a**5*b**2*f
+ 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)
) - C*a**3*b**2*d*log(tan(e + f*x)**2 + 1)/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**
2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + 2*C*a**3*b**2*d/(2*a**5*b**2*f + 2*a**4*b**3*f*t
an(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) - 2*C*a**2*b**3
*c*f*x*tan(e + f*x)/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) +
2*a*b**6*f + 2*b**7*f*tan(e + f*x)) - 4*C*a**2*b**3*c*log(a/b + tan(e + f*x))/(2*a**5*b**2*f + 2*a**4*b**3*f*
tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + 2*C*a**2*b**
3*c*log(tan(e + f*x)**2 + 1)/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e
+ f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) - 2*C*a**2*b**3*c/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) +
4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) - 4*C*a**2*b**3*d*f*x/(2*a**5
*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(
e + f*x)) + 6*C*a**2*b**3*d*log(a/b + tan(e + f*x))*tan(e + f*x)/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) +
4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) - C*a**2*b**3*d*log(tan(e +
f*x)**2 + 1)*tan(e + f*x)/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e +
f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + 2*C*a*b**4*c*f*x/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*
a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) - 4*C*a*b**4*c*log(a/b + tan(e
+ f*x))*tan(e + f*x)/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x)
+ 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + 2*C*a*b**4*c*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*a**5*b**2*f + 2*
a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) -
4*C*a*b**4*d*f*x*tan(e + f*x)/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(
e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + C*a*b**4*d*log(tan(e + f*x)**2 + 1)/(2*a**5*b**2*f + 2*a**4*b
**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + 2*C*b*
*5*c*f*x*tan(e + f*x)/(2*a**5*b**2*f + 2*a**4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x)
+ 2*a*b**6*f + 2*b**7*f*tan(e + f*x)) + C*b**5*d*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*a**5*b**2*f + 2*a**
4*b**3*f*tan(e + f*x) + 4*a**3*b**4*f + 4*a**2*b**5*f*tan(e + f*x) + 2*a*b**6*f + 2*b**7*f*tan(e + f*x)), True
))
Maxima [A] (verification not implemented)
none
Time = 0.37 (sec) , antiderivative size = 338, normalized size of antiderivative = 1.28
\[
\int \frac {(c+d \tan (e+f x)) \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^2} \, dx=\frac {\frac {2 \, {\left ({\left ({\left (A - C\right )} a^{2} + 2 \, B a b - {\left (A - C\right )} b^{2}\right )} c - {\left (B a^{2} - 2 \, {\left (A - C\right )} a b - B b^{2}\right )} d\right )} {\left (f x + e\right )}}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} - \frac {2 \, {\left ({\left (B a^{2} b^{2} - 2 \, {\left (A - C\right )} a b^{3} - B b^{4}\right )} c - {\left (C a^{4} - {\left (A - 3 \, C\right )} a^{2} b^{2} - 2 \, B a b^{3} + A b^{4}\right )} d\right )} \log \left (b \tan \left (f x + e\right ) + a\right )}{a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}} + \frac {{\left ({\left (B a^{2} - 2 \, {\left (A - C\right )} a b - B b^{2}\right )} c + {\left ({\left (A - C\right )} a^{2} + 2 \, B a b - {\left (A - C\right )} b^{2}\right )} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} - \frac {2 \, {\left ({\left (C a^{2} b - B a b^{2} + A b^{3}\right )} c - {\left (C a^{3} - B a^{2} b + A a b^{2}\right )} d\right )}}{a^{3} b^{2} + a b^{4} + {\left (a^{2} b^{3} + b^{5}\right )} \tan \left (f x + e\right )}}{2 \, f}
\]
[In]
integrate((c+d*tan(f*x+e))*(A+B*tan(f*x+e)+C*tan(f*x+e)^2)/(a+b*tan(f*x+e))^2,x, algorithm="maxima")
[Out]
1/2*(2*(((A - C)*a^2 + 2*B*a*b - (A - C)*b^2)*c - (B*a^2 - 2*(A - C)*a*b - B*b^2)*d)*(f*x + e)/(a^4 + 2*a^2*b^
2 + b^4) - 2*((B*a^2*b^2 - 2*(A - C)*a*b^3 - B*b^4)*c - (C*a^4 - (A - 3*C)*a^2*b^2 - 2*B*a*b^3 + A*b^4)*d)*log
(b*tan(f*x + e) + a)/(a^4*b^2 + 2*a^2*b^4 + b^6) + ((B*a^2 - 2*(A - C)*a*b - B*b^2)*c + ((A - C)*a^2 + 2*B*a*b
- (A - C)*b^2)*d)*log(tan(f*x + e)^2 + 1)/(a^4 + 2*a^2*b^2 + b^4) - 2*((C*a^2*b - B*a*b^2 + A*b^3)*c - (C*a^3
- B*a^2*b + A*a*b^2)*d)/(a^3*b^2 + a*b^4 + (a^2*b^3 + b^5)*tan(f*x + e)))/f
Giac [A] (verification not implemented)
none
Time = 0.66 (sec) , antiderivative size = 518, normalized size of antiderivative = 1.95
\[
\int \frac {(c+d \tan (e+f x)) \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^2} \, dx=\frac {\frac {2 \, {\left (A a^{2} c - C a^{2} c + 2 \, B a b c - A b^{2} c + C b^{2} c - B a^{2} d + 2 \, A a b d - 2 \, C a b d + B b^{2} d\right )} {\left (f x + e\right )}}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} + \frac {{\left (B a^{2} c - 2 \, A a b c + 2 \, C a b c - B b^{2} c + A a^{2} d - C a^{2} d + 2 \, B a b d - A b^{2} d + C b^{2} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} - \frac {2 \, {\left (B a^{2} b^{2} c - 2 \, A a b^{3} c + 2 \, C a b^{3} c - B b^{4} c - C a^{4} d + A a^{2} b^{2} d - 3 \, C a^{2} b^{2} d + 2 \, B a b^{3} d - A b^{4} d\right )} \log \left ({\left | b \tan \left (f x + e\right ) + a \right |}\right )}{a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}} + \frac {2 \, {\left (B a^{2} b^{2} c \tan \left (f x + e\right ) - 2 \, A a b^{3} c \tan \left (f x + e\right ) + 2 \, C a b^{3} c \tan \left (f x + e\right ) - B b^{4} c \tan \left (f x + e\right ) - C a^{4} d \tan \left (f x + e\right ) + A a^{2} b^{2} d \tan \left (f x + e\right ) - 3 \, C a^{2} b^{2} d \tan \left (f x + e\right ) + 2 \, B a b^{3} d \tan \left (f x + e\right ) - A b^{4} d \tan \left (f x + e\right ) - C a^{4} c + 2 \, B a^{3} b c - 3 \, A a^{2} b^{2} c + C a^{2} b^{2} c - A b^{4} c - B a^{4} d + 2 \, A a^{3} b d - 2 \, C a^{3} b d + B a^{2} b^{2} d\right )}}{{\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} {\left (b \tan \left (f x + e\right ) + a\right )}}}{2 \, f}
\]
[In]
integrate((c+d*tan(f*x+e))*(A+B*tan(f*x+e)+C*tan(f*x+e)^2)/(a+b*tan(f*x+e))^2,x, algorithm="giac")
[Out]
1/2*(2*(A*a^2*c - C*a^2*c + 2*B*a*b*c - A*b^2*c + C*b^2*c - B*a^2*d + 2*A*a*b*d - 2*C*a*b*d + B*b^2*d)*(f*x +
e)/(a^4 + 2*a^2*b^2 + b^4) + (B*a^2*c - 2*A*a*b*c + 2*C*a*b*c - B*b^2*c + A*a^2*d - C*a^2*d + 2*B*a*b*d - A*b^
2*d + C*b^2*d)*log(tan(f*x + e)^2 + 1)/(a^4 + 2*a^2*b^2 + b^4) - 2*(B*a^2*b^2*c - 2*A*a*b^3*c + 2*C*a*b^3*c -
B*b^4*c - C*a^4*d + A*a^2*b^2*d - 3*C*a^2*b^2*d + 2*B*a*b^3*d - A*b^4*d)*log(abs(b*tan(f*x + e) + a))/(a^4*b^2
+ 2*a^2*b^4 + b^6) + 2*(B*a^2*b^2*c*tan(f*x + e) - 2*A*a*b^3*c*tan(f*x + e) + 2*C*a*b^3*c*tan(f*x + e) - B*b^
4*c*tan(f*x + e) - C*a^4*d*tan(f*x + e) + A*a^2*b^2*d*tan(f*x + e) - 3*C*a^2*b^2*d*tan(f*x + e) + 2*B*a*b^3*d*
tan(f*x + e) - A*b^4*d*tan(f*x + e) - C*a^4*c + 2*B*a^3*b*c - 3*A*a^2*b^2*c + C*a^2*b^2*c - A*b^4*c - B*a^4*d
+ 2*A*a^3*b*d - 2*C*a^3*b*d + B*a^2*b^2*d)/((a^4*b + 2*a^2*b^3 + b^5)*(b*tan(f*x + e) + a)))/f
Mupad [B] (verification not implemented)
Time = 21.30 (sec) , antiderivative size = 1875, normalized size of antiderivative = 7.08
\[
\int \frac {(c+d \tan (e+f x)) \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^2} \, dx=\text {Too large to display}
\]
[In]
int(((c + d*tan(e + f*x))*(A + B*tan(e + f*x) + C*tan(e + f*x)^2))/(a + b*tan(e + f*x))^2,x)
[Out]
(log(a + b*tan(e + f*x))*(b^4*(A*d + B*c) - b^3*(2*B*a*d - 2*A*a*c + 2*C*a*c) - b^2*(A*a^2*d + B*a^2*c - 3*C*a
^2*d) + C*a^4*d))/(f*(b^6 + 2*a^2*b^4 + a^4*b^2)) - (log((A*B*b^4*d^2 - A*B*b^4*c^2 + B*C*a^4*d^2 + B*C*b^4*c^
2 - A^2*b^4*c*d + B^2*b^4*c*d + C^2*a^4*c*d - A^2*a*b^3*c^2 + A^2*a*b^3*d^2 + B^2*a*b^3*c^2 - B^2*a*b^3*d^2 -
C^2*a*b^3*c^2 + C^2*a*b^3*d^2 + A*B*a^2*b^2*c^2 - A*B*a^2*b^2*d^2 - B*C*a^2*b^2*c^2 + 3*B*C*a^2*b^2*d^2 + A^2*
a^2*b^2*c*d - B^2*a^2*b^2*c*d + 3*C^2*a^2*b^2*c*d - A*C*a^4*c*d + A*C*b^4*c*d + 2*A*C*a*b^3*c^2 - 2*A*C*a*b^3*
d^2 - 4*A*C*a^2*b^2*c*d + 4*A*B*a*b^3*c*d - 4*B*C*a*b^3*c*d)/(b*(a^2 + b^2)^2) + (tan(e + f*x)*(A^2*b^4*c^2 +
B^2*b^4*d^2 + C^2*a^4*d^2 + C^2*b^4*c^2 + C^2*b^4*d^2 + A^2*a^2*b^2*d^2 + B^2*a^2*b^2*c^2 + 3*C^2*a^2*b^2*d^2
- A*C*a^4*d^2 - 2*A*C*b^4*c^2 - A*C*b^4*d^2 - 4*A*C*a^2*b^2*d^2 - 2*A*B*b^4*c*d - B*C*a^4*c*d + B*C*b^4*c*d -
2*A*B*a*b^3*c^2 + 2*A*B*a*b^3*d^2 + 2*B*C*a*b^3*c^2 - 2*B*C*a*b^3*d^2 - 2*A^2*a*b^3*c*d + 2*B^2*a*b^3*c*d - 2*
C^2*a*b^3*c*d + 2*A*B*a^2*b^2*c*d - 4*B*C*a^2*b^2*c*d + 4*A*C*a*b^3*c*d))/(b*(a^2 + b^2)^2) + ((c + d*1i)*(A +
B*1i - C)*(A*b*c - B*b*d - 4*C*a*d - C*b*c + (tan(e + f*x)*(3*A*b^4*d + 3*B*b^4*c + 2*C*a^4*d - 5*C*b^4*d + 4
*A*a*b^3*c - 4*B*a*b^3*d - 4*C*a*b^3*c - A*a^2*b^2*d - B*a^2*b^2*c + C*a^2*b^2*d))/(b*(a^2 + b^2)) + (b*(c + d
*1i)*(4*a*b - a^2*tan(e + f*x) + 3*b^2*tan(e + f*x))*(A + B*1i - C)*1i)/(a*1i - b)^2)*1i)/(2*(a*1i - b)^2))*(A
*c + A*d*1i + B*c*1i - B*d - C*c - C*d*1i))/(2*f*(2*a*b - a^2*1i + b^2*1i)) - (log((A*B*b^4*d^2 - A*B*b^4*c^2
+ B*C*a^4*d^2 + B*C*b^4*c^2 - A^2*b^4*c*d + B^2*b^4*c*d + C^2*a^4*c*d - A^2*a*b^3*c^2 + A^2*a*b^3*d^2 + B^2*a*
b^3*c^2 - B^2*a*b^3*d^2 - C^2*a*b^3*c^2 + C^2*a*b^3*d^2 + A*B*a^2*b^2*c^2 - A*B*a^2*b^2*d^2 - B*C*a^2*b^2*c^2
+ 3*B*C*a^2*b^2*d^2 + A^2*a^2*b^2*c*d - B^2*a^2*b^2*c*d + 3*C^2*a^2*b^2*c*d - A*C*a^4*c*d + A*C*b^4*c*d + 2*A*
C*a*b^3*c^2 - 2*A*C*a*b^3*d^2 - 4*A*C*a^2*b^2*c*d + 4*A*B*a*b^3*c*d - 4*B*C*a*b^3*c*d)/(b*(a^2 + b^2)^2) + (ta
n(e + f*x)*(A^2*b^4*c^2 + B^2*b^4*d^2 + C^2*a^4*d^2 + C^2*b^4*c^2 + C^2*b^4*d^2 + A^2*a^2*b^2*d^2 + B^2*a^2*b^
2*c^2 + 3*C^2*a^2*b^2*d^2 - A*C*a^4*d^2 - 2*A*C*b^4*c^2 - A*C*b^4*d^2 - 4*A*C*a^2*b^2*d^2 - 2*A*B*b^4*c*d - B*
C*a^4*c*d + B*C*b^4*c*d - 2*A*B*a*b^3*c^2 + 2*A*B*a*b^3*d^2 + 2*B*C*a*b^3*c^2 - 2*B*C*a*b^3*d^2 - 2*A^2*a*b^3*
c*d + 2*B^2*a*b^3*c*d - 2*C^2*a*b^3*c*d + 2*A*B*a^2*b^2*c*d - 4*B*C*a^2*b^2*c*d + 4*A*C*a*b^3*c*d))/(b*(a^2 +
b^2)^2) + ((c*1i + d)*(B*1i - A + C)*(A*b*c - B*b*d - 4*C*a*d - C*b*c + (tan(e + f*x)*(3*A*b^4*d + 3*B*b^4*c +
2*C*a^4*d - 5*C*b^4*d + 4*A*a*b^3*c - 4*B*a*b^3*d - 4*C*a*b^3*c - A*a^2*b^2*d - B*a^2*b^2*c + C*a^2*b^2*d))/(
b*(a^2 + b^2)) + (b*(c*1i + d)*(4*a*b - a^2*tan(e + f*x) + 3*b^2*tan(e + f*x))*(B*1i - A + C))/(a*1i + b)^2))/
(2*(a*1i + b)^2))*(A*c*1i + A*d + B*c - B*d*1i - C*c*1i - C*d))/(2*f*(a*b*2i - a^2 + b^2)) - (A*b^3*c - C*a^3*
d - A*a*b^2*d - B*a*b^2*c + B*a^2*b*d + C*a^2*b*c)/(b^2*f*(a^2 + b^2)*(a + b*tan(e + f*x)))